home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / Aztec C v5.2a disk 4.adf / 204inc_i.lzh / libraries / commodities.i < prev    next >
Text File  |  1991-03-14  |  6KB  |  193 lines

  1.     IFND LIBRARIES_COMMODITIES_I
  2. LIBRARIES_COMMODITIES_I    SET 1
  3. **   $Filename: libraries/commodities.i $
  4. **   $Release: 2.04 $
  5. **   $Revision: 1.2 $
  6. **   $Date: 91/02/22 $
  7. **
  8. **   Commodities definitions
  9. **
  10. **   (C) Copyright 1988,1989,1990 Commodore-Amiga Inc.
  11. **    All Rights Reserved
  12. *-----------------------------------------------------------*
  13.  
  14.     IFND EXEC_TYPES_I
  15.     INCLUDE "exec/types.i"
  16.  
  17.     ENDC
  18.     IFND DEVICES_INPUTEVENT_I
  19.     INCLUDE "devices/inputevent.i"
  20.     ENDC
  21.  
  22.  
  23. ***************
  24. * Broker stuff
  25. ***************
  26.  
  27. * buffer sizes
  28. CBD_NAMELEN    EQU    24
  29. CBD_TITLELEN    EQU    40
  30. CBD_DESCRLEN    EQU    40
  31.  
  32. * CxBroker errors
  33. CBERR_OK    EQU    0     ; No error
  34. CBERR_SYSERR    EQU    1     ; System error , no memory, etc
  35. CBERR_DUP    EQU    2     ; uniqueness violation
  36. CBERR_VERSION    EQU    3     ; didn't understand nb_VERSION     
  37. NB_VERSION     EQU    5        ; Version of NewBroker structure   
  38.  
  39.     STRUCTURE NewBroker,0
  40.        BYTE         nb_Version         ; set to NB_VERSION
  41.        BYTE        nb_Reserve1    ; for alignment
  42.        APTR         nb_Name
  43.        APTR         nb_Title
  44.        APTR         nb_Descr
  45.        WORD        nb_Unique
  46.        WORD        nb_Flags
  47.        BYTE     nb_Pri            ; new in V5   
  48.        BYTE        nb_Reserve2    ; for alignment
  49.        APTR        nb_Port
  50.        WORD         nb_ReservedChannel     ;plans for later port sharing
  51.  
  52. ***********************
  53. * Flags for nb_Unique 
  54. ***********************
  55.  
  56. NBU_DUPLICATE     EQU       0
  57. NBU_UNIQUE     EQU       1        ; will not allow duplicates        
  58. NBU_NOTIFY     EQU       2        ; sends CXM_UNIQUE to existing broker 
  59.  
  60. * Flags for nb_Flags 
  61. COF_SHOW_HIDE     EQU       4
  62.  
  63. ********
  64. * cxusr
  65. ********
  66.  
  67. ********************************
  68. ** Commodities Object Types   **
  69. ********************************
  70. CX_INVALID     EQU    0     ; not a valid object (probably null)  
  71. CX_FILTER     EQU    1     ; input event messages only           
  72. CX_TYPEFILTER     EQU    2     ; filter on message type              
  73. CX_SEND     EQU    3     ; sends a message                     
  74. CX_SIGNAL     EQU    4     ; sends a signal                      
  75. CX_TRANSLATE     EQU    5     ; translates IE into chain            
  76. CX_BROKER     EQU    6     ; application representative          
  77. CX_DEBUG     EQU    7     ; dumps kprintf to serial port        
  78. CX_CUSTOM     EQU    8     ; application provids function        
  79. CX_ZERO     EQU    9     ; system terminator node              
  80.  
  81. *****************
  82. ** CxMsg types **
  83. *****************
  84. CXM_UNIQUE     EQU       $10 ; (1 << 4) sent down broker by CxBroker()      
  85. ; Obsolete: subsumed by CXM_COMMAND (below)   
  86.  
  87. * Messages of this type rattle around the Commodities input network.
  88. * They will be sent to you by a Sender object, and passed to you
  89. * as a synchronous function call by a Custom object.
  90. *
  91. * The message port or function entry point is stored in the object,
  92. * and the ID field of the message will be set to what you arrange
  93. * issuing object.
  94. *
  95. * The Data field will point to the input event triggering the
  96. * message.
  97.  
  98. CXM_IEVENT     EQU       $20 ;(1 << 5)
  99.  
  100. * These messages are sent to a port attached to your Broker.
  101. * They are sent to you when the controller program wants your
  102. * program to do something.  The ID field identifies the command.
  103. * The Data field will be used later.
  104. *
  105.  
  106. CXM_COMMAND     EQU       $40 ;(1 << 6)
  107.  
  108. * ID values
  109.  
  110. CXCMD_DISABLE     EQU    15  ; please disable yourself       
  111. CXCMD_ENABLE     EQU    17  ; please enable yourself        
  112. CXCMD_APPEAR     EQU    19  ; open your window, if you can  
  113. CXCMD_DISAPPEAR EQU    21  ; go dormant                    
  114. CXCMD_KILL     EQU    23  ; go away for good              
  115. CXCMD_UNIQUE     EQU    25  ; someone tried to create a brok
  116.                             ; with your name.  Suggest you Appear.
  117. CXCMD_LIST_CHG     EQU    27  ; Used by Exchange program. Someone 
  118.                             ; has changed the broker list       
  119.  
  120. * return values for BrokerCommand()
  121. CMDE_OK     EQU        0
  122. CMDE_NOBROKER     EQU      -1
  123. CMDE_NOPORT     EQU      -2
  124. CMDE_NOMEM     EQU      -3
  125.  
  126. * IMPORTANT NOTE: for V5:
  127. * Only CXM_IEVENT messages are passed through the input network.
  128. *
  129. * Other types of messages are sent to an optional port in your broker.
  130. *
  131. * This means that you must test the message type in your message handling,
  132. * if input messages and command messages come to the same port.
  133. *
  134. * Older programs have no broker port, so processing loops which
  135. * make assumptions about type won't encounter the new message types.
  136. *
  137. * The TypeFilter CxObject is hereby obsolete.
  138. *
  139. * It is less convenient for the application, but eliminates testing
  140. * for type of input messages.
  141.  
  142. **********************************************************
  143. ** CxObj Error Flags (return values from CxObjError())    **
  144. **********************************************************
  145.  
  146. COERR_ISNULL        EQU    1  ; you called CxError(NULL)
  147. COERR_NULLATTACH    EQU    2  ; someone attached NULL to my list
  148. COERR_BADFILTER    EQU    4  ; a bad filter description was given
  149. COERR_BADTYPE        EQU    8  ; unmatched type-specific operation
  150.  
  151.  
  152. ******************************
  153. * Input Expression structure *
  154. ******************************
  155.  
  156. IX_VERSION    EQU       2
  157.  
  158.     STRUCTURE InputXpression,0
  159.  
  160.        UBYTE   ix_Version       ; must be set to IX_VERSION
  161.        UBYTE   ix_Class       ; class must match exactly
  162.  
  163.        UWORD   ix_Code       ; Bits that we want
  164.  
  165.        UWORD   ix_CodeMask       ; Set bits here to indicate
  166.                    ; which bits in ix_Code are
  167.                    ; don't care bits.           
  168.  
  169.        UWORD   ix_Qualifier    ; Bits that we want
  170.  
  171.        UWORD   ix_QualMask     ; Set bits here to indicate
  172.                                ; which bits in ix_Qualifier
  173.                    ; are don't care bits
  174.  
  175.        UWORD   ix_QualSame      ; synonyms in qualifier
  176.  
  177.     LABEL    ix_SIZEOF
  178.  
  179. * QualSame identifiers
  180. IXSYM_SHIFT    EQU      1    ; left- and right- shift are equivalent
  181. IXSYM_CAPS    EQU      2    ; either shift or caps lock are equivalent
  182. IXSYM_ALT    EQU      4    ; left- and right- alt are equivalent
  183.  
  184. * corresponding QualSame masks
  185. IXSYM_SHIFTMASK EQU     IEQUALIFIER_LSHIFT!IEQUALIFIER_RSHIFT
  186. IXSYM_CAPSMASK        EQU     IXSYM_SHIFTMASK!IEQUALIFIER_CAPSLOCK
  187. IXSYM_ALTMASK    EQU     IEQUALIFIER_LALT!IEQUALIFIER_RALT
  188.  
  189. IX_NORMALQUALS        EQU      $7FFF  ;for QualMask field: avoid RELATIVEMOUSE
  190.  
  191.     ENDC    ; LIBRARIES_COMMODITIES_I
  192.